import { defineStore } from "pinia";
import { ref } from "vue";

// token
export const useToken = defineStore('token', () => {
  const token = ref('')
  const setToken = (value: string) => {
    token.value = value;
  }
  const delToken = () => {
    token.value = '';
  }
  return { token, setToken, delToken }
}, { persist: true })
// userinfo
export const useUserinfo = defineStore('userinfo', () => {
  const userinfo = ref(null)
  const setUserinfo = (value: any) => {
    userinfo.value = value;
  }
  const delUserinfo = () => {
    userinfo.value = null;
  }
  return { userinfo, setUserinfo, delUserinfo }
}, { persist: true })
// record 100
export const useRecord100 = defineStore('record100', () => {
  const record100 = ref(false)
  const setRecord100 = (value: boolean) => {
    record100.value = value;
  }
  return { record100, setRecord100 }
})